package work.ib.apt.perf;

import java.util.HashMap;
import java.util.Map;
import java.util.Random;

public class GetMSA extends TestMain {

	//	private static final String url = "http://localhost:8000/services/geographic/v1/getMsa";
	private static final String url = "http://dev-aptratings-services1.internetbrands.com:8080/services/geographic/v1/getMsa";

	private static final Integer parallelThreads = 10;

	private static String[] cityStateDev = new String[] {
		"LUMBERVILLE,PA",
		"TEMPLETON,MA",
		"M C B H KANEOHE BAY,HI",
		"WEST MILTON,OH",
		"GRINDSTONE,PA",
		"SALISBURY,MA",
		"CANASTOTA,NY",
		"SULPHUR SPRINGS,OH",
		"PERRYOPOLIS,PA",
		"DELANO,MN",
		"BROOKS,CA",
		"COLUMBIA CITY,OR",
		"SELDEN,NY",
		"EDROY,TX",
		"FAIRVIEW,PA",
		"ORTONVILLE,MI",
		"HIBBS,PA",
		"GOODFIELD,IL",
		"CHARLOTTE,NC",
		"WAVERLY,MN",
		"MOSHANNON,PA",
		"DACULA,GA",
		"CANUTILLO,TX",
		"PORT GAMBLE,WA",
		"ECHO LAKE,CA",
		"CROMWELL,CT",
		"VERONA BEACH,NY",
		"TRUMBULL,CT",
		"LAGUNITAS,CA",
		"WYOMING,MI",
		"JOHNSON,NY",
		"MERRIMAC,MA",
		"STRONGSVILLE,OH",
		"VAN ALSTYNE,TX",
		"MIDDLEFIELD,OH",
		"RED HILL,PA",
		"HUME,VA",
		"SMYRNA,GA",
		"LOUISVILLE,TN",
		"WEST YARMOUTH,MA",
		"WHITEWRIGHT,TX",
		"MOUNT PLEASANT,OH",
		"BOVARD,PA",
		"EGAN,LA",
		"SHALLOTTE,NC",
		"ROGERS,TX",
		"SEDALIA,CO",
		"CHILDS,MD",
		"HURLEY,MS",
		"CHELSEA,NY",
		"GLENWOOD,NJ",
		"PAEONIAN SPRINGS,VA",
		"SEQUOIA NATIONAL PARK,CA",
		"FORT WASHINGTON,MD",
		"NORTH BOSTON,NY",
		"BRIDGEPORT,PA",
		"FORT MYERS BEACH,FL",
		"SILVERHILL,AL",
		"NEW ELLENTON,SC",
		"WALDWICK,NJ",
		"POSEYVILLE,IN",
		"LAUREL HILL,FL",
		"WARSAW,KY",
		"FLAGSTAFF,AZ",
		"BOXBOROUGH,MA",
		"CARBONDALE,PA",
		"LATHROP,CA",
		"ILA,GA",
		"SKILLMAN,NJ",
		"CARLISLE,NY",
		"EAGLE,NE",
		"ONA,WV",
		"NORTH CHARLESTON,SC",
		"HAPPY JACK,AZ",
		"CEDARPINES PARK,CA",
		"ROARING SPRING,PA",
		"UNION,MO",
		"MIDDLE ISLAND,NY",
		"BEASLEY,TX",
		"LOUGHMAN,FL",
		"MOUNT OLIVE,AL",
		"CONCORDVILLE,PA",
		"PINE PLAINS,NY",
		"LECOMPTON,KS",
		"JOHNSONVILLE,SC",
		"ENGLEWOOD,FL",
		"HYGIENE,CO",
		"MINERAL POINT,PA",
		"OKAUCHEE,WI",
		"GRAY,GA",
		"MIDDLEBURG,VA",
		"SOUTH DARTMOUTH,MA",
		"BEDFORD,NH",
		"CENTER MORICHES,NY",
		"SCITUATE,MA",
		"HAMPTON,IL",
		"WESTOVER,AL",
		"SAFETY HARBOR,FL",
		"BERRYSBURG,PA",
		"GRAMERCY,LA",
	};

	private static String[] cityStateLocal = new String[] {
		"GRAMERCY,LA",
	};

	public static void main(String[] args) {
		try {
			new GetMSA().runTest();
		} catch (Exception e) {
			e.printStackTrace(System.out);
		}
	}

	@Override
	public Map<String, Object> getParameters() {
		String[] dataArray = cityStateDev;
		String[] data = dataArray[new Random().nextInt(dataArray.length)].split(",");
		Map<String,Object> params = new HashMap<String,Object>();

		params.put("city", data[0]);
		params.put("state", data[1]);
		params.put("format", "json");

		return params;
	}

	@Override
	public int getParallelThreads() {
		return parallelThreads;
	}

	@Override
	public String getURL() {
		return url;
	}
}
